home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3p / usopenpollsema.z / usopenpollsema
Encoding:
Text File  |  2002-10-03  |  5.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. UUUUSSSSOOOOPPPPEEEENNNNPPPPOOOOLLLLLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))                                          UUUUSSSSOOOOPPPPEEEENNNNPPPPOOOOLLLLLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      usopenpollsema - attach a file descriptor to a pollable semaphore
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<uuuulllloooocccckkkkssss....hhhh>>>>
  13.  
  14.      iiiinnnntttt uuuussssooooppppeeeennnnppppoooollllllllsssseeeemmmmaaaa ((((uuuusssseeeemmmmaaaa____tttt ****sssseeeemmmmaaaa,,,, mmmmooooddddeeee____tttt aaaacccccccc))));;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _u_s_o_p_e_n_p_o_l_l_s_e_m_a attaches a file descriptor to a pollable semaphore.  The
  18.      returned file descriptor is used when calling _p_o_l_l(2) or _s_e_l_e_c_t(2) to
  19.      acquire the semaphore after an unsuccessful _u_s_p_s_e_m_a(3P).
  20.  
  21.      If the caller is the first process to call _u_s_o_p_e_n_p_o_l_l_s_e_m_a on _s_e_m_a then a
  22.      new semaphore device is allocated (see _u_s_e_m_a(7M)).  The user and group id
  23.      of the semaphore device take on the effective user/group id of the
  24.      caller.  The access mode is set to _a_c_c(see _c_h_m_o_d(2)).  Calls to
  25.      _u_s_o_p_e_n_p_o_l_l_s_e_m_a on the same semaphore by other processes simply attach to
  26.      the previously allocated device.  They must pass standard Unix file
  27.      permission tests to be allowed to attach.
  28.  
  29.      All processes sharing a pollable semaphore, related and unrelated alike,
  30.      must call _u_s_o_p_e_n_p_o_l_l_s_e_m_a before performing any semaphore operation on
  31.      _s_e_m_a.
  32.  
  33.      Forked children must perform their own _u_s_o_p_e_n_p_o_l_l_s_e_m_a, as the file
  34.      descriptor inherited from the parent through the _f_o_r_k(2) will not be
  35.      usable.
  36.  
  37.      A process requires the file descriptor to call _u_s_v_s_e_m_a even if it never
  38.      calls _u_s_p_s_e_m_a.
  39.  
  40.      _u_s_o_p_e_n_p_o_l_l_s_e_m_a will fail if one or more of the following are true:
  41.  
  42.      [EACCES]      The caller does not have the required permission to open
  43.                    one or both of the two semaphore device files, ////ddddeeeevvvv////uuuusssseeeemmmmaaaa
  44.                    and ////ddddeeeevvvv////uuuusssseeeemmmmaaaacccclllloooonnnneeee.
  45.  
  46.      [EACCES]      The caller is attempting to attach to a previously
  47.                    allocated semaphore device and does not have the requisite
  48.                    permissions.
  49.  
  50.      [ENOSPC]      There are no more selectable semaphores available in the
  51.                    system.  This is configurable up to 255.  See
  52.                    ////vvvvaaaarrrr////ssssyyyyssssggggeeeennnn////mmmmaaaasssstttteeeerrrr....dddd////uuuusssseeeemmmmaaaa.
  53.  
  54.      [EMFILE]      The system imposed limit for open file descriptors per
  55.                    process {_O_P_E_N__M_A_X} has already been reached.
  56.  
  57.      [ENFILE]      The system file table has exceeded {_N_F_I_L_E__M_A_X} concurrently
  58.                    open files.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. UUUUSSSSOOOOPPPPEEEENNNNPPPPOOOOLLLLLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))                                          UUUUSSSSOOOOPPPPEEEENNNNPPPPOOOOLLLLLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))
  71.  
  72.  
  73.  
  74.      [ENXIO]       One or both of the two semaphore device files, ////ddddeeeevvvv////uuuusssseeeemmmmaaaa
  75.                    and ////ddddeeeevvvv////uuuusssseeeemmmmaaaacccclllloooonnnneeee, do not exist, or the device is not
  76.                    configured into the system.
  77.  
  78. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  79.      chmod(2), open(2), amalloc(3P), usclosepollsema(3P), usconfig(3P),
  80.      uscpsema(3P), usctlsema(3P), usdumpsema(3P), usfreesema(3P),
  81.      usfreepollsema(3P), usinit(3P), usnewsema(3P), usnewpollsema(3P),
  82.      uspsema(3P), usvsema(3P), usema(7M).
  83.  
  84. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  85.      Upon successful completion, a file descriptor is returned. Otherwise, a
  86.      value of -1 is returned and _e_r_r_n_o is set to indicate the error.
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.